home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 11657 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  850 b 

  1. Path: bragg.bio.purdue.edu!RWA
  2. From: rwa@bragg.bio.purdue.edu
  3. Newsgroups: comp.lang.c
  4. Subject: FORTRAN and floats
  5. Date: 25 Mar 1996 18:30:00 GMT
  6. Organization: Purdue University, Dept. of Biological Sciences
  7. Message-ID: <4j6on8$fif@mozo.cc.purdue.edu>
  8. Reply-To: rwa@bragg.bio.purdue.edu
  9. NNTP-Posting-Host: bragg.bio.purdue.edu
  10.  
  11. Hi -
  12.  
  13. I'm sure this is an easy one ... ;-)
  14.  
  15. I write a "float" from C in Ultrix to a disk file as follows:
  16.  
  17.     fwrite(&myFloat,sizeof(float),1,fOut);
  18.  
  19. I get over to my Alpha Open VMS box and try and read it with FORTRAN and
  20. get gibberish.  (Also can't do when writing from FORTRAN/VMS and reading in Ultrix/C).
  21.  
  22. So FORTRAN/VMS likes a different format for floats than C/Ultrix.
  23. This is a portability issue that I'm sure there's a "clean" way to
  24. solve it - does anyne have any ideas for me???
  25.  
  26. ???
  27.  
  28. Rob
  29. rwa@babe.bio.purdue.edu
  30.